package org.example.config;

import lombok.Data;
import org.example.fault.retry.RetryStrategyKeys;
import org.example.fault.tolerant.TolerantStrategyKeys;
import org.example.loadbalancer.LoadBalancerKeys;
import org.example.serializer.SerializerKeys;

/**
 * rpc配置类
 */
@Data
public class RpcConfig {
    /**
     * 名称
     */
    private  String name = "rpc";
    /**
     * 服务端端口
     */
    private  Integer serverPort = 8080;
    /**
     * 服务端地址
     * */
    private  String serverHost = "localhost";
    /**
     * 版本号
     */
    private  String version = "1.0";
    /**
     * 模拟调用
     */
    private boolean mock = false;
    /**
     * 序列化方式
     */
    private String serializer = SerializerKeys.JDK;
    /**
     * 注册中心配置
     */
    private RegistryConfig registryConfig = new RegistryConfig();
    /**
     * 负载均衡器
     */
    private String loadBalancer = LoadBalancerKeys.ROUND_ROBIN;
    /**
     * 重试策略
     */
    private String retryStrategy = RetryStrategyKeys.NO;
    /**
     * 容错策略
     */
    private String tolerantStrategy = TolerantStrategyKeys.FAIL_FAST;
}
